package com.imti.mall.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.imti.mall.model.order.pojo.OmsOrder;
import com.imti.mall.model.order.pojo.OmsOrderReturnApply;
import com.imti.mall.model.order.pojo.OmsOrderReturnReason;
import com.imti.mall.model.order.query.OmsOrderDelivery;
import com.imti.mall.model.order.query.OmsOrderQuery;
import com.imti.mall.model.order.vo.OmsOrderAndItem;
import com.imti.mall.model.order.vo.OmsOrderDetail;
import com.imti.mall.model.order.vo.OmsOrderMoneyInfo;
import com.imti.mall.model.order.vo.OmsOrderReceiverInfo;

import java.text.ParseException;
import java.util.List;

/**
 * 订单管理Service
 */

public interface OrderService extends IService<OmsOrder> {

    /**
     * 订单查询
     */
    List<OmsOrder> list(OmsOrderQuery queryParam, Integer pageSize, Integer pageNum);

    /**
     * 根据订单ID获取订单详情
     */
    OmsOrderDetail detail(Long orderId);
    /**
     * 根据订单id删除订单
     */
    int deletebyId(Long id);

/**
     * 根据订单id关闭订单
     * @param omsOrder
     * @return
     */
    int closeOrderById(OmsOrder omsOrder);

    /**
     * 根据订单id对订单进行备注
     * @param omsOrder
     * @return
     */
    int noteById(OmsOrder omsOrder);

    /**
     * 发货，插入快递公司以及单号,修改订单状态
     * @param omsOrderDelivery
     * @return
     */

    int updateOrderForDelivery(OmsOrderDelivery omsOrderDelivery);

    /**
     * 根据id查询订单以及商品信息（app端）
     * @param queryParam
     * @param pageSize
     * @param pageNum
     * @return
     */
    List<OmsOrderAndItem>  findOrderAndItemById(OmsOrderQuery queryParam, Integer pageSize, Integer pageNum);

    /**
     * 修改收货信息
     * @param omsOrderReceiverInfo
     * @return
     */
    int updateReceiverInfo(OmsOrderReceiverInfo omsOrderReceiverInfo);

    /**
     * 修改订单金额
     * @param omsOrderMoneyInfo
     * @return
     */
    int updateOrderMoney(OmsOrderMoneyInfo omsOrderMoneyInfo);

  
    boolean addMethod(List<OmsOrderReturnApply> omsOrderReturnApplyList, OmsOrderReturnReason omsOrderReturnReason) throws ParseException;


    int updateOrderPay(String orderSn,Integer payType);

    int insertAll(OmsOrder omsOrder);

}
